/*<script setup>
// This starter template is using Vue 3 <script setup> SFCs
// Check out https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup
import HelloWorld from './components/HelloWorld'
</script>

<template>
  <img alt="Vue logo" src="./assets/logo.png" />
  <HelloWorld msg="Hello Vue 3 + Vite" />
</template>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>*/

import { defineComponent, reactive } from "vue";
import HelloWorld from "./components/HelloWorld";

export default defineComponent({
  name: 'App',
  setup() {
    const color = reactive({
      fontColor: 'red'
    })
    const slots = {
      default: () => (<span> default slots</span>),
      name: () => (<span> name slots</span>),
    }
    return () => (
      <div>
        <p style={{color: color.fontColor}}>~~ red ~~</p>
        <p style={{color: 'blue'}}>~~ blue ~~</p>
        <p style="color: #cde">~~ yellow ~~</p>
        <p class="red">~~ text ~~</p>
        <p class={{'red-blue': 1===1}}>~~ text ~~</p>
        <HelloWorld v-slots={ slots } />
        {/* 路由出口 */}
        {/* 路由匹配到的组件将渲染在这里 */}
        <router-view />
      </div>
    )
  }
})

/*export default defineComponent(() => {
  const state = reactive({
    count: 0,
    list: []
  })

  function inc() {
    state.count++
    state.list.push(state.count)
  }
  return () => (
    <div>
      <button onClick={inc}>add</button>
      <p>The count:</p>
      <p style="with: 200px">{ state.count }</p>
      <input v-model={state.count} />
      {state.count % 2 === 0 && <span> ~~ v-if ~~</span>}
      { {state.list.map(item => {
        return <p>{item}</p>
      })} }
      { state.list.map(it => (
        <p>{it}</p>
      )) }
    </div>
  )
})*/
